﻿#include "servicecenter.h"
#include <QGlobalConfig>
#include <QDir>
#include <QCoreApplication>
#include <filestoragecontroller.h>

ServiceCenter::ServiceCenter(QObject *parent) : QObject(parent)
{
    qDebug() << __FUNCTION__ << QCoreApplication::applicationDirPath() + "/" + QCoreApplication::applicationName() + ".ini";
    QGlobalConfig::getInstance().init(QCoreApplication::applicationDirPath() + "/" + QCoreApplication::applicationName() + ".ini");

    QString rootPath = QGlobalConfig::getInstance().read("storage", "rootPath", "D:/FileStorage").toString();

    HttpService::getInstance().installController("file",new FileStorageController());
}

ServiceCenter::~ServiceCenter()
{
    qDebug() << __FUNCTION__;
    QGlobalConfig::deleteInstance();
}
